package com.gidgabs.modules.dao;

import com.gidgabs.common.utils.Assist;
import com.gidgabs.modules.entity.TbUserFollowEntity;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户关系表-关注表
 * 
 * @author lanyonglin
 * @email www.baidu.com
 * @date 2018-07-02 10:07:07
 */
@Mapper
@Repository
public interface TbUserFollowDao extends BaseDao<TbUserFollowEntity> {
    /**
     * 获得TbUserFollowEntity数据的总行数,可以通过辅助工具Assist进行条件查询,如果没有条件则传入null
     *
     * @param assist
     * @return
     */
    long getTbUserFollowRowCount(Assist assist);

    /**
     * 获得TbUserFollowEntity数据集合,可以通过辅助工具Assist进行条件查询,如果没有条件则传入null
     *
     * @param assist
     * @return
     */
    List<TbUserFollowEntity> selectTbUserFollowEntity(Assist assist);
    /**
     * 通过TbUserFollowEntity的id获得TbUserFollowEntity对象
     *
     * @param id
     * @return
     */
    TbUserFollowEntity selectTbUserFollowById(Integer id);

    /**
     * 获得一个TbUserFollowEntity对象,以参数TbUserFollowEntity对象中不为空的属性作为条件进行查询,返回符合条件的第一条
     *
     * @param obj
     * @return
     */
    TbUserFollowEntity selectTbUserFollowObjSingle(TbUserFollowEntity obj);

    /**
     * 获得一个TbUserFollowEntity对象,以参数TbUserFollowEntity对象中不为空的属性作为条件进行查询
     *
     * @param obj
     * @return
     */
    List<TbUserFollowEntity> selectTbUserFollowByObj(TbUserFollowEntity obj);

    /**
     * 插入TbUserFollowEntity到数据库,包括null值
     *
     * @param value
     * @return
     */
    int insertTbUserFollowEntity(TbUserFollowEntity value);

    /**
     * 插入TbUserFollowEntity中属性值不为null的数据到数据库
     *
     * @param value
     * @return
     */
    int insertNotNullTbUserFollowEntity(TbUserFollowEntity value);

    /**
     * 批量插入TbUserFollowEntity到数据库,包括null值
     *
     * @param value
     * @return
     */
    int insertTbUserFollowByBatch(List<TbUserFollowEntity> value);
    /**
     * 通过TbUserFollowEntity的id删除TbUserFollowEntity
     *
     * @param id
     * @return
     */
    int deleteTbUserFollowById(Integer id);

    /**
     * 通过辅助工具Assist的条件删除TbUserFollowEntity
     *
     * @param assist
     * @return
     */
    int deleteTbUserFollowByAssist(Assist assist);

    /**
     * 通过TbUserFollowEntity的id更新TbUserFollowEntity中的数据,包括null值
     *
     * @param enti
     * @return
     */
    int updateTbUserFollowById(TbUserFollowEntity enti);

    /**
     * 通过TbUserFollowEntity的id更新TbUserFollowEntity中属性不为null的数据
     *
     * @param enti
     * @return
     */
    int updateNotNullTbUserFollowById(TbUserFollowEntity enti);

    /**
     * 通过辅助工具Assist的条件更新TbUserFollowEntity中的数据,包括null值
     *
     * @param value
     * @param assist
     * @return
     */
    int updateTbUserFollowEntity(@Param("enti") TbUserFollowEntity value, @Param("assist") Assist assist);

    /**
     * 通过辅助工具Assist的条件更新TbUserFollowEntity中属性不为null的数据
     *
     * @param value
     * @param assist
     * @return
     */
    int updateNotNullTbUserFollowEntity(@Param("enti") TbUserFollowEntity value, @Param("assist") Assist assist);

    int getFollowCount(Integer shouldUserId);
}
